/**
 * 内嵌的属性映射
 */
import EntityPropertyMapping from './EntityPropertyMapping.js';

export default class EmbeddedPropertyMapping extends EntityPropertyMapping {

    /**
     * 对应的逻辑属性id
     * @type {string}
     */
    logicPropertyId = '';
    /**
     * 对应的逻辑属性名称
     * @type {string}
     */
    logicPropertyName = '';
    caption = '';

    static of(object) {
        if (typeof object !== 'object') {
            return undefined;
        }
        let field = new EmbeddedPropertyMapping();
        field.update(object);
        return field;
    }

    clone() {
        return EmbeddedPropertyMapping.of(this);
    }

}
